﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ApplyInterView.aspx.cs"
    Inherits="BOH.AccreditationSystem.ApplyInterView" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <link href="../style/css.css" type="text/css" rel="Stylesheet" />

    <script src="../js/jquery-1.3.2.js" type="text/javascript"></script>

    <script src="../js/common.js" type="text/javascript"></script>
<script>
    function checkSearch() {
        var Govern = $("#<%=drpGovern.ClientID %>");
        var subject = $("#<%=drpSubject.ClientID %>");
        var JobRank = $("#<%=drpJobRank.ClientID %>");
        if (Govern.val()!="-1"||subject.val() != "-1" || JobRank.val() != "-1") {
            return true;
        }
        else {
            alert("请选择查询条件");
            return false;
        }
    }

    function CheckSet() { 
        var Govern = $("#<%=drpGovern.ClientID %>");
        var subject = $("#<%=drpSubject.ClientID %>");
        var JobRank = $("#<%=drpJobRank.ClientID %>");
        var Month = $("#<%=drpInteviewMonth.ClientID %>");
        var Day = $("#<%=drpInteviewday.ClientID %>");
        var HH = $("#<%=drpHH.ClientID %>");
        var MM = $("#<%=drpMM.ClientID %>");
        if ((Govern.val()!="-1"||subject.val() != "-1" || JobRank.val() != "-1" )&& Month.val().length > 0 && Day.val().length > 0 && HH.val().length > 0 && MM.val().length > 0) {
            return true;
        }
        else {
            alert("请设置查询条件和面试时间");
            return false;
        }
    }
    function ShowPrintPage()
     {
            var JobRank = $("#<%=drpJobRank.ClientID %>").val();
            var SubjectID = $("#<%=drpSubject.ClientID %>").val();
            var Govern = $("#<%=drpGovern.ClientID %>").val();
            if(JobRank==undefined)
                JobRank ="-1";
             if(SubjectID==undefined)
                SubjectID = "-1";
             if(Govern=="-1"&&JobRank=="-1"&&SubjectID=="-1")
             {
                 alert("请选择查询条件!");
             }
             else
             {
                if (navigator.appName == "Netscape") {
                    var result = window.open("PrintInterview.aspx?Govern=" + Govern+"&SubjectID=" + SubjectID + "&JobRank=" + JobRank, "通知打印");
                    result.focus();
                } else {
                    window.open("PrintInterview.aspx?Govern=" + Govern+"&SubjectID=" + SubjectID + "&JobRank=" + JobRank, "通知打印");
                }
              }
        }
    
    function ShowPrintListPage()
    {
           var Govern = $("#<%=drpGovern.ClientID %>").val();
           var SubjectID = $("#<%=drpSubject.ClientID %>").val();
           if(Govern == undefined)
                Govern = "-1";
           if(SubjectID == undefined)
                SubjectID = "-1";
           if(SubjectID=="-1"&&Govern=="-1")
           {
                alert("请选择学查询条件!");
           }
           else
           {
                if (navigator.appName == "Netscape") {
                    var result = window.open("PrintInterviewList.aspx?Govern="+Govern+"&Subject=" + SubjectID , "通知打印");
                    result.focus();
                } else {
                    window.open("PrintInterviewList.aspx?Govern="+Govern+"&Subject=" + SubjectID , "通知打印");
                }
            }
    }
    
    function ShowSinglePrint(ApplyID)
    {
        if(ApplyID.length>0)
        {
            if (navigator.appName == "Netscape") {
                var result = window.open("PrintInterview.aspx?ApplyID=" + ApplyID, "通知打印");
                result.focus();
            } else {
                window.open("PrintInterview.aspx?ApplyID=" + ApplyID, "通知打印");
            }
        }
        else
        {
            alert("请先设置申请编号");
        }
    }
        function setInterviewTime(obj) {
            var tr = $(obj).parents("tr");
            $(tr).find("select").each(
                function() {
                    if (this.id.indexOf("drpInteviewMonth") > 0) {
                        var strMonth = $("#drpInteviewMonth").val();
                        this.value = strMonth;
                    }
                    if (this.id.indexOf("drpInteviewday") > 0) {
                        var strDay = $("#drpInteviewday").val();
                        this.value = strDay;
                    }
                    if (this.id.indexOf("drpHH") > 0) {
                        var strHH = $("#drpHH").val();
                        this.value = strHH;
                    }
                    if (this.id.indexOf("drpMM") > 0) {
                        var strMM = $("#drpMM").val();
                        this.value = strMM;
                    }
                }
            );
        }
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="divNavigation">
        当前位置:<a href="OverView.aspx" target="frameControl">评审管理系统</a> >> 面试安排
    </div>
    <div id="bodyDiv">
        <div id="divSearch">
            <span id="SpanSetup3" runat="server">
            主管局：<asp:DropDownList ID="drpGovern" runat="server"></asp:DropDownList>&nbsp;&nbsp; </span>
            <span id="SpanSetup2" runat="server">
            学科组:<asp:DropDownList ID="drpSubject" Width="120px" runat="server"></asp:DropDownList>
            &nbsp;&nbsp;
            申报职称:<asp:DropDownList ID="drpJobRank" runat="server" ></asp:DropDownList>
            &nbsp;&nbsp;&nbsp;</span>
            <asp:Button ID="butSearch"  runat="server" Text="查 询" Width="100px" OnClientClick="return checkSearch()" onclick="butSearch_Click" />&nbsp;&nbsp;
        </div>
        <div id="divSearch">
            <span id="SpanSetup" runat="server">
            面试时间:&nbsp;<asp:DropDownList ID="drpInteviewMonth" runat="server"></asp:DropDownList>月&nbsp;<asp:DropDownList ID="drpInteviewday" runat="server"></asp:DropDownList>日&nbsp;<asp:DropDownList ID="drpHH" runat="server"></asp:DropDownList>:<asp:DropDownList ID="drpMM" runat="server"></asp:DropDownList>
              &nbsp;&nbsp;<asp:Button ID="butSetDateTime" runat="server" Text="批量设置面试时间"  OnClientClick="return CheckSet()"
                onclick="butSetDateTime_Click" />&nbsp;&nbsp;<asp:Button ID="butSaveTime" runat="server" Text="保存面试时间" onclick="butSaveTime_Click" /></span>&nbsp;
                <asp:Button ID="butPrint"  OnClientClick="ShowPrintPage(); return false;" runat="server" Text="批量打印面试通知" />&nbsp;<asp:Button ID="butPrintList" runat="server" Text="打印学科组面试安排表" OnClientClick="ShowPrintListPage(); return false;" />
                
         </div>
    </div>
    <div id="divGrid">
        
        <asp:GridView ID="ApplyViewList" runat="server" AutoGenerateColumns="False" 
            Width="1000" CssClass="Grid" 
            onrowcreated="ApplyViewList_RowCreated" 
            onrowdatabound="ApplyViewList_RowDataBound" 
            ondatabound="ApplyViewList_DataBound">
           <%-- <PagerSettings Mode="NumericFirstLast" />--%><%--AllowPaging="True" PageSize="15" --%>
            <Columns>
                <asp:TemplateField HeaderText="设置">
                    <ItemTemplate>
                        <asp:HiddenField ID="hideInterviewID" runat="server" Value='<%#Eval("InterViewID") %>' />
                        <asp:HiddenField ID="hidenApplyID" runat="server" Value='<%#Eval("ApplyID") %>' />
                        <a href="#" onclick='setInterviewTime(this); return false'>设置</a>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="45px"/>
                    <ItemStyle HorizontalAlign="Center"  Width="45px"/>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="打印">
                    <HeaderStyle Width="40px" HorizontalAlign="Center"/>
                    <ItemStyle Width="40px" HorizontalAlign="Center"/>
                    <ItemTemplate>
                        <a href="#" onclick=ShowSinglePrint('<%#Eval("ApplyID") %>')>打印</a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="申报编号">
                    <ItemTemplate>
                        <asp:Label ID="labPrintID" Text='<%#Eval("ApplyPrintID") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="70px" HorizontalAlign="left"/>
                    <ItemStyle Width="70px" HorizontalAlign="left"/>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="工作单位">
                    <ItemTemplate>
                        <asp:Label ID="labGovrenUnit" Text='<%#Eval("UnitGovernName") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="200px" />
                    <ItemStyle Width="200px"/>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="姓 名">
                    <ItemTemplate>
                        <asp:Label ID="labApplyName" Text='<%#Eval("Apply_Name") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="50px" HorizontalAlign="Center"/>
                    <ItemStyle Width="50px" HorizontalAlign="Center"/>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="性别">
                    <ItemTemplate>
                        <asp:Label ID="labGender" Text='<%#Eval("Gender") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="30px" HorizontalAlign="Center"/>
                    <ItemStyle Width="30px" HorizontalAlign="Center"/>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="申报职称">
                    <ItemTemplate>
                        <asp:Label ID="labJobRankName" Text='<%#Eval("JobRankName") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="90px" />
                    <ItemStyle Width="90px"/>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="申报学科组">
                    <ItemTemplate>
                        <asp:Label ID="labSpecialityName" Text='<%#Eval("SubjectName") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="150px" />
                    <ItemStyle Width="150px"/>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="面试时间">
                    <ItemTemplate>
                        <asp:HiddenField ID="hideMonth" runat="server" Value='<%#Eval("InterView_Month") %>' /><asp:HiddenField ID="hideday" runat="server" Value='<%#Eval("InterView_Day") %>'  /><asp:HiddenField ID="hidenHH" runat="server" Value='<%#Eval("interview_TimeHH") %>' /><asp:HiddenField ID="hideMM" runat="server" Value='<%#Eval("interview_TimeMM") %>' />
                        <asp:DropDownList ID="drpInteviewMonth" runat="server"></asp:DropDownList>月<asp:DropDownList ID="drpInteviewday" runat="server"></asp:DropDownList>日<asp:DropDownList ID="drpHH" runat="server"></asp:DropDownList>:<asp:DropDownList ID="drpMM" runat="server"></asp:DropDownList>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="210px" />
                    <ItemStyle HorizontalAlign="Center" Width="210px"/>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="是否设置">
                    <ItemTemplate>
                        <asp:Label ID="labIsSet" Text='<%#Eval("isSet") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="65px" HorizontalAlign="Center"/>
                    <ItemStyle Width="65px " HorizontalAlign="Center"/>
                </asp:TemplateField>
                
            </Columns>
            <AlternatingRowStyle CssClass="ARow" />
        </asp:GridView>
        <div id="divPager">
            <asp:Label ID="labNoRecord" Visible="false" runat="server" Text="查询结果为空!"></asp:Label>
            <%--<webdiyer:AspNetPager ID="AspNetPager1" runat="server" PageSize="15" AlwaysShow="True"
                OnPageChanged="AspNetPager1_PageChanged" ShowCustomInfoSection="Left" CustomInfoSectionWidth="30%"
                ShowPageIndexBox="always" PageIndexBoxType="DropDownList" CustomInfoHTML="第<font color='red'><b>%currentPageIndex%</b></font>页，共%PageCount%页，每页显示%PageSize%条记录">
            </webdiyer:AspNetPager>--%>
        </div>
    </div>
    </form>
</body>
</html>
